<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('地区交易量1')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>是否会员：</label>
                            <input type="text" name="type"/>
                        </li>
                        <li>
                            <label>费率类型：</label>
                            <input type="text" oninput="value=value.replace(/[^\d]/g,'')" name="proportion"/>
                        </li>
                        <li>
                            <label>终端类型：</label>
                            <input type="text" oninput="value=value.replace(/[^\d]/g,'')" name="isthird"/>
                        </li>
                        <li class="select-time">
                            <label style="width: 100px">起始日期：</label>
                            <input type="text" class="time-input" id="startTime" th:value="${mindDate}"  placeholder="开始时间" name="mindDate"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime"  th:value="${maxDate}" placeholder="结束时间" name="maxDate"/>
                        </li>
                        <li class="select-time">
                            <label style="width: 100px">结束日期：</label>
                            <input type="text" class="time-input" id="startTime1" th:value="${mindDate1}"  placeholder="开始时间" name="mindDate"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime1"  th:value="${maxDate1}" placeholder="结束时间" name="maxDate"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="addRoutRateType()" shiro:hasPermission="tBankinfo:tBankinfo:addRoutRateType">
                <i class="fa fa-plus"></i> 添加
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('tBankinfo:tBankinfo:editRoutRateType')}]];
    var removeFlag = [[${@permission.hasPermi('tBankinfo:tBankinfo:removeRoutRateType')}]];
    var prefix = ctx + "tBankinfo/tBankinfo";
    $(function()  {
        var options = {
            url: prefix + "/listRoutRateTypeMap",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            clickToSelect:true,
            columns: [
                {
                    field : 'TYPE',
                    title : '是否会员'
                },
                {
                    field : 'BEGINIDX',
                    title : '开始'
                },
                {
                    field : 'ENDIDX',
                    title : '结束'
                },
                {
                    field : 'PROPORTION',
                    title : '费率类型'
                },
                {
                    field : 'ISTHIRD',
                    title : '终端类型'
                },
                {
                    field : 'BEGINAMT',
                    title : '前金额段',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field : 'ENDAMT',
                    title : '后金额段',
                    formatter: function (value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field : 'BEGINHOUR',
                    title : '生效前时间段'
                },
                {
                    field : 'ENDHOUR',
                    title : '生效后时间段'
                },
                {
                    field : 'BEGINDATE',
                    title : '起始日期'
                },
                {
                    field : 'ENDDATE',
                    title : '结束日期'
                },
                {
                    field : 'NEWPRO',
                    title : '新用户标准'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editRoutRateType(\''+row.ID+'\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="removeRoutRateType(\'' + row.ID + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
    function addRoutRateType() {
        $.modal.open("新增地区交易量1",prefix + "/addRoutRateType/" ,'800');
    }

    function editRoutRateType(id) {
        $.modal.open("修改地区交易量1",prefix + "/editRoutRateType/"+id ,'800');
    }

    function removeRoutRateType(id) {
        $.modal.confirm("删除需谨慎，确定删除吗？", function() {
            $.operate.post(prefix + "/removeRoutRateType", { "id": id});
        })
    }
</script>
</body>
</html>